package org.anarcoding.twitterbot.view;

import java.util.List;

import org.anarcoding.twitterbot.model.AnarcoTwitterBot;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;

public class AnarcoTwitterPrincipalTableConfig implements IStructuredContentProvider, ITableLabelProvider, ITableColorProvider {

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	@Override
	public void inputChanged( Viewer arg0, Object arg1, Object arg2 ) {
		// TODO Auto-generated method stub

	}

	@Override
	public void addListener( ILabelProviderListener arg0 ) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isLabelProperty( Object arg0, String arg1 ) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void removeListener( ILabelProviderListener arg0 ) {
		// TODO Auto-generated method stub

	}

	@Override
	public Color getBackground( Object arg0, int arg1 ) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Color getForeground( Object arg0, int arg1 ) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Image getColumnImage( Object arg0, int arg1 ) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getColumnText( Object bot, int idx ) {
		AnarcoTwitterBot tbot = (AnarcoTwitterBot)bot;

		switch( idx ) {
			case 0:
				return "Test Alias";
			case 1:
				return tbot.isStatus() ? "ACTIVO" : "INACTIVO";
			case 2:
				return "O.O Sabra dios que sea esto";
		}

		return "";
	}

	@SuppressWarnings( "rawtypes" )
	@Override
	public Object [] getElements( Object list ) {
		List lista = (List)list;

		return lista.toArray();
	}

}
